<?php

namespace Kateba\OrderBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Kateba\OrderBundle\Entity\UserOrder
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Kateba\OrderBundle\Entity\UserOrderRepository")
 */
class UserOrder {

    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var Kateba\UserBundle\Entity\Address $address
     * 
     * @ORM\ManyToOne(targetEntity="Kateba\UserBundle\Entity\Address", inversedBy="userOrders")
     * @ORM\JoinColumn(name="addressId", referencedColumnName="id", onDelete="CASCADE", onUpdate="CASCADE", nullable=false)
     */
    private $address;

    /**
     * @var Doctrine\Common\Collections\ArrayCollection $ordersDetails
     * 
     * @ORM\OneToMany(targetEntity="Kateba\OrderBundle\Entity\OrderDetail", mappedBy="userOrder", cascade={"all"}, orphanRemoval=true)
     */
    private $orderDetails;

    /**
     * @var datetime $date
     *
     * @ORM\Column(name="date", type="datetime")
     */
    private $date;

    /**
     * @var text $comment
     *
     * @ORM\Column(name="comment", type="text")
     */
    private $comment;

    /**
     * @var smallint $status
     *
     * @ORM\Column(name="status", type="smallint")
     */
    private $status;

    /**
     * @var decimal $totalPrice
     *
     * @ORM\Column(name="totalPrice", type="decimal", precision=10, scale=2)
     */
    private $totalPrice;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId() {
        return $this->id;
    }

    /**
     * Set date
     *
     * @param datetime $date
     */
    public function setDate($date) {
        $this->date = $date;
    }

    /**
     * Get date
     *
     * @return datetime 
     */
    public function getDate() {
        return $this->date;
    }

    /**
     * Set comment
     *
     * @param text $comment
     */
    public function setComment($comment) {
        $this->comment = $comment;
    }

    /**
     * Get comment
     *
     * @return text 
     */
    public function getComment() {
        return $this->comment;
    }

    /**
     * Set status
     *
     * @param smallint $status
     */
    public function setStatus($status) {
        $this->status = $status;
    }

    /**
     * Get status
     *
     * @return smallint 
     */
    public function getStatus() {
        return $this->status;
    }

    /**
     * Set totalPrice
     *
     * @param decimal $totalPrice
     */
    public function setTotalPrice($totalPrice) {
        $this->totalPrice = $totalPrice;
    }

    /**
     * Get totalPrice
     *
     * @return decimal 
     */
    public function getTotalPrice() {
        return $this->totalPrice;
    }

    public function __construct() {
        $this->orderDetails = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Set address
     *
     * @param Kateba\UserBundle\Entity\Address $address
     */
    public function setAddress(\Kateba\UserBundle\Entity\Address $address) {
        $this->address = $address;
    }

    /**
     * Get address
     *
     * @return Kateba\UserBundle\Entity\Address 
     */
    public function getAddress() {
        return $this->address;
    }

    /**
     * Add orderDetails
     *
     * @param Kateba\OrderBundle\Entity\OrderDetail $orderDetails
     */
    public function addOrderDetail(\Kateba\OrderBundle\Entity\OrderDetail $orderDetails) {
        $this->orderDetails[] = $orderDetails;
    }

    /**
     * Get orderDetails
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getOrderDetails() {
        return $this->orderDetails;
    }

}